<?php
$file_name = "../ptnhuan-web1/data/films.txt";

$file_path = realpath($file_name);
$film = array();


$file = fopen($file_path, "r");

while (!feof($file)){
    $films[]=  trim(fgets($file));
}
fclose($file);

?>
<?php foreach ($films as $line ): ?>
<?php if (!empty($line)):?>
<?php   $film = explode(";",$line);?>

<img src="../ptnhuan-web1/public/images/films/<?php echo $film[1];?>">
     <?php echo $film[2];?>
<?php echo $film[3];?>
<a href="edit.php">Edit</a>
</br>

<?php endif; ?>
<?php endforeach; ?>



